package com.controller;


import com.entity.Course;
import com.github.pagehelper.PageInfo;
import com.service.CourseService;
import com.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    CourseService courseService;

//    "pageNo":pageNo  "course_type_id":id

//    pageNo  ajax   data：{“1”：pageno}
    @RequestMapping("/findAllCourse.do")
    public AjaxResult findAllCourse(Integer pageNo,Integer course_type_id){
        AjaxResult ajaxResult = new AjaxResult();
        PageInfo<Course> courseAll = courseService.findCourseAll(pageNo, course_type_id);
        ajaxResult.setObj(courseAll);
        return ajaxResult;
    }
}
